<?php 
	session_start();
	date_default_timezone_set("UTC");
	
	$ticket_parent=1;
	
	require("auth.php");
	
	$errors = array();
	$warnings = array();
	$status = array();

	require("dbconnect.php");
	require("functions.php");

	$_SESSION["user"] = array();
	//$_SESSION["user"]["name"] = "Guest";
	//$_SESSION["user"]["member_id"] = 0;
	//$_SESSION["user"]["member_group_id"] = 0;
	$_SESSION["user"]["name"] = "Cross Barret";
	$_SESSION["user"]["member_id"] = 1;
	$_SESSION["user"]["member_group_id"] = 1;
	
	//if ($_SESSION["user"]["member_id"] == 0) {
	//	header("Location: http://www.agony-unleashed.com/index.php?app=core&module=global&section=login");
	//	exit;
	//}
	
	
	if(!is_logged_in()){
		$page="upcoming";
	}
	else if (isset($_GET["page"])){
		if($_GET["page"] == "admin" && !is_admin()){
			$page="upcoming";
		}
		else{
			$page=$_GET["page"];
		}
		
	}
	else {
		$page="upcoming";
	}
	
	if(file_exists($page."_handlers.php"))
		require $page."_handlers.php"
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Agony Unleashed - Class Manager</title>
		<link rel="stylesheet" href="styles/style.css" media="screen" />
	</head>

	<body>
		<?php require "header.php";
			if($page != "admin") require "messages.php";
			require $page.".php";?>
		
	</body>
	
</html>